/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package healthcare.coursework.model;

import java.io.Serializable;
import java.util.List;

/**
 *
 * @author Administrator
 */
public class Outlet implements Serializable {
    private static final long serialVersionUID = 1L;

    private Integer outletId;
    private String outletName;
    private List<Users> users;

    public Outlet() {
    }

    public Outlet(Integer outletId) {
        this.outletId = outletId;
    }

    public Outlet(Integer outletId, String outletName) {
        this.outletId = outletId.intValue();
        this.outletName = outletName;
    }

    public Integer getOutletId() {
        return outletId;
    }

    public void setOutletId(Integer outletId) {
        this.outletId = outletId;
    }

    public String getOutletName() {
        return outletName;
    }

    public void setOutletName(String outletName) {
        this.outletName = outletName;
    }

    public List<Users> getUsers() {
        return users;
    }

    public void setUsers(List<Users> users) {
        this.users = users;
    }

   

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (outletId != null ? outletId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Outlet)) {
            return false;
        }
        Outlet other = (Outlet) object;
        if ((this.outletId == null && other.outletId != null) || (this.outletId != null && !this.outletId.equals(other.outletId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "healthcare.coursework.model.Outlet[outletId=" + outletId + "]";
    }

    public void addUser(Users user) {
        getUsers().add(user);
    }

}
